© Copyright Microsoft Corporation, 2003. All rights reserved.
The SQL Server documentation team cannot answer technical support questions, but welcomes your suggestions and comments about this readme documentation. You can quickly and directly send e-mail feedback using the link below. All feedback must be in English. To submit written feedback about this document, click here: Submit feedback.
Overview
PrinterDeliverySample offers an introduction on how to write a custom delivery extension. The sample delivers reports to a printer using Reporting Services' delivery API. This sample features the use of the IMAGE rendering extension along with the System.Drawing namespace in the .NET Framework.
Topics
The following bullets briefly describe the classes and technologies used by this sample.
Location
The sample code files are located in the Extensions\PrinterDeliverySample subdirectory of the Reporting Services samples directory.
For Example:
C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\Samples\Extensions\PrinterDeliverySample
Building and deploying the sample
In order to properly build and run this sample, the following steps need to be performed.
To build the sample using the .NET Framework SDK
csc /t:library /out:Microsoft.Samples.ReportingServices.PrinterDelivery.dll *.cs /r:Microsoft.ReportingServices.Interfaces.dll
To build the sample using Visual Studio .NET
The Add References dialog box opens.
The selected reference is added to your project.
After you have completed the previous steps, Microsoft.Samples.ReportingServices.PrinterDeliverySample.dll can then be deployed to a report server and to Report Manager for use in delivering reports.
To deploy the sample
<Extension Name="Printer Delivery Sample" Type="Microsoft.Samples.ReportingServices.PrinterDeliverySample.PrinterDeliveryProvider,Microsoft.Samples.ReportingServices.PrinterDeliverySample">
<Configuration>
<Printers>
<Printer>\\Server\MyNetworkPrinter1</Printer>
<Printer>\\Server\MyNetworkPrinter2</Printer>
<Printer>MyLocalPrinter</Printer>
</Printers>
</Configuration>
</Extension>
NOTE: The Printers element is designed to enable a fixed set of printer names to be available for the delivery extension Printer setting. This list is ultimately checked against the known list of available printers on the report server to which the delivery extension is installed. If a selected printer does not match the known list of installed printers on the report server, the delivery fails with status, "The printer {0} is not currently installed on the server."
<Extension Name="Printer Delivery Sample" Type="Microsoft.Samples.ReportingServices.PrinterDeliverySample.PrinterDeliveryUIProvider,Microsoft.Samples.ReportingServices.PrinterDeliverySample"/>
To configure code access security for the sample
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="PrinterDeliveryCodeGroup"
Description="Code group for my delivery extension">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.PrinterDeliverySample.dll"
/>
</CodeGroup>
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="PrinterDeliveryCodeGroup"
Description="Code group for my delivery extension">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportManager\bin\Microsoft.Samples.ReportingServices.PrinterDeliverySample.dll"
/>
</CodeGroup>
The default location for the rsmgrpolicy.config file is C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportManager.
Notes
For information about implementing a Reporting Services delivery extension, see "Implementing a Delivery Extension" in Reporting Services Books Online.